﻿using MLSMooc.DAO.Implement.Book;
using MLSMooc.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace MLSMooc.Controllers
{
    public class BookController : Controller
    {
        BookDAO bookDAO = BookDAO.Getinstance();

        [HttpGet]
        public async Task<string> GetByIdBookInfo(string id)
        {
            var res = await bookDAO.GetByIdBookInfo(id);
            return SerializeHelper.SerializeJson(res);
        }

        [HttpGet]
        public async Task<string> GetBookAllList()
        {
            var res = await bookDAO.GetBookAllList();
            return SerializeHelper.SerializeJson(res);
        }
    }
}